﻿//  --------------------------------
//  Copyright (c) 2010 Michael Schuler, Sascha Burger. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://p2pmessaging.codeplex.com/license
//  ---------------------------------
namespace p2pMessaging.Interfaces
{
	/// <summary>
	/// Interface to provide basic security.
	/// </summary>
	public interface ICryptographyService
	{
		/// <summary>
		/// Encrypt a plain byte array into cipher byte array.
		/// </summary>
		/// <param name="plain">plain byte array</param>
		/// <param name="algorithm">algorithm to encrypt</param>
		/// <param name="password">password to encrypt</param>
		/// <returns>cipher byte array</returns>
		byte[] Encrypt(byte[] plain, CryptographyServiceAlgorithm algorithm, string password);

		/// <summary>
		/// Decrypt a cipher byte array into plain byte array.
		/// </summary>
		/// <param name="cipher">cipher byte array</param>
		/// <param name="algorithm">algorithm to decrypt</param>
		/// <param name="password">password to decrypt</param>
		/// <returns>plain byte array</returns>
		byte[] Decrypt(byte[] cipher, CryptographyServiceAlgorithm algorithm, string password);
	}
}
